# -*- coding: utf-8 -*- 
# @project : 《Atcoder》
# @Author : created by bensonrachel on 2021/6/26
# @File : C - Unexpressed.py

N = int(input())#以a入手,直接找2-sq内的数的x次方是否在N内
sq = int(N ** 0.5)
s = set()
for a in range(2, sq + 1):
    x = a * a
    while x <= N:
        s.add(x)
        x *= a
print(N - len(s))